package guardian


class CoreInterceptor {

    CoreInterceptor(){
        matchAll().excludes(controller:"login")
    }
    boolean before() {
        if(controllerName && !session.loginUser){
            redirect(controller:"login", action:"index")
            return false
        }
        return true
    }

    boolean after() { true }

    void afterView() {
        // no-op
    }
}
